package com.example.kotlindemo.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.kotlindemo.fragments.HomeFragment
import com.example.kotlindemo.fragments.MessageFragment
import com.example.kotlindemo.fragments.ProfileFragment

class ViewPagerTabAdapter(activity: FragmentActivity) : FragmentStateAdapter(activity) {
    private val fragments = listOf(
        HomeFragment(),
        MessageFragment(),
        ProfileFragment()
    )
    override fun getItemCount(): Int = fragments.size

    override fun createFragment(position: Int): Fragment = fragments[position]
}